package com.gancai.admin.interceptor;

import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.context.annotation.Configuration;

import java.util.UUID;

/**
 * @author GanGan
 */

@Configuration
public class TokenRequestInterceptor implements RequestInterceptor {


    //openfeign请求拦截器
    @Override
    public void apply(RequestTemplate requestTemplate) {
        requestTemplate.header("X-Token", UUID.randomUUID().toString());
    }
}
